package com.ljh.mall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.ljh.common.valid.ListValue;
import com.ljh.common.valid.groups.AddGroupsInterface;
import com.ljh.common.valid.groups.UpdateGroupsInterface;
import lombok.Data;
import org.hibernate.validator.constraints.URL;
import org.springframework.data.repository.NoRepositoryBean;

import javax.validation.constraints.*;

/**
 * Ʒ��
 * 
 * @author ljh
 * @email 1612435061@qq.com
 * @date 2022-11-13 16:26:35
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@NotNull(message = "更新数据品牌ID必须不为空" , groups = {UpdateGroupsInterface.class})
	@Null(message = "添加品牌信息品牌ID必须为空" ,groups = {AddGroupsInterface.class})
	@TableId
	private Long brandId;
	/**
	 * 品牌名
	 * @NotEmpty 用在集合类上面
	 * @NotBlank 用在String上面
	 * @NotNull 用在基本类型上
	 */
	@NotBlank(message = "品牌的名称不能为空")
	private String name;
	/**
	 * 品牌logo地址
	 */
	@NotBlank(message = "logo不能为空")
	@URL(message = "logo必须是一个合法URL地址")
	private String logo;
	/**
	 * 介绍
	 */
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
	@NotNull(message = "显示状态不能为空", groups = AddGroupsInterface.class)
	@ListValue(val = {0,1},groups = {AddGroupsInterface.class,UpdateGroupsInterface.class})
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	@NotBlank(message = "检索首字母不能为空")
	@Pattern(regexp = "/^[a-zA-Z]$/", message = "检索首字母必须是单个的字母")
	private String firstLetter;
	/**
	 * 排序
	 */
	@NotNull(message = "排序不能为null")
	@Min(value = 0,message = "排序不能小于0")
	private Integer sort;

}
